The physical storage media of a hard disk drive (HDD) is divided into units called physical sectors. Data on a hard disk drive is written and read in minimum units of physical sectors. As such, hard disk drives may be referred to as block-based devices. By comparison, byte-addressable memories (e.g., RAM, random access memory) allow individual bytes of data to be written and read. Industry standard disk drives have used a native (physical) 512 bytes (B) sector size for decades. However, due to the increasing demand for larger capacities, the storage industry has introduced new advanced formats that use 4 KB (4096 bytes) physical sectors.
Storage devices with a native sector size of 4 KB have become increasingly more popular over the last few years. However, many aspects of computer systems have been designed assuming physical sector sizes of 512 B. Although some operating systems (OSs) have been rewritten for native 4 KB storage devices, oftentimes upgrading existing software systems may require application changes that involve complex compatibility issues in mixed configurations, require upgrade paths that are logistically challenging and disruptive to an organization, incur costs in terms of manpower, time, and money, and so on. Accordingly, legacy systems have been slow in adapting to the advanced format.
To ease the transition, solutions typically involve a technique sometimes referred to as 512-byte emulation (512e) in order to allow legacy systems to use 4 KB native storage while avoiding time-consuming, expensive, and error-prone changes to such systems. 512-byte emulation allows a system to perform I/O using 512 B logical sectors, but which in reality take place on 4 KB physical sectors. Typically, 512-byte emulation involves read-modify-write (RMW) operations when doing write operations. In order to write a 512-byte logical sector onto a 4 KB native storage device, a read operation is performed to read in the 4 KB block of data from the 4 KB physical sector of storage device that contains the 512-byte logical sector. The 512-byte logical sector is written to the appropriate location in the 4 KB block that was read in (modify operation), followed by a write operation of the 4 KB block back to the 4 KB physical sector. It can be appreciated that 512e is susceptible to latency and lower throughput due to the additional I/O.
For the cases where transactions are not required, usually caches can avoid the overhead of RMW, by reducing the number of I/Os. For transactional applications such as databases and file systems implementations, this is not really an option. If the persistence is not guaranteed when the application relies on it, corruptions and unpredictable execution can follow power failures or OS crashes. To guarantee that a write operation becomes persistent when the call completes, conventional approaches typically need for the data to be committed (written) on the physical storage device. If the logical sector size is smaller than the physical sector size, RMW can triple the latency of the write operation, assuming that the reads and writes have similar latency. In the worst-case scenario for HDDs, with competing I/O operations from other threads in the system, RMW may be impacted due to the resulting additional seeks on the HDD by the other threads.